﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Faculty
{
    class Student
    {
        public string FirstName;
        public string LastName;
        public DateTime DateOfBirth;
        public int[] Marks = new int[5];
        private static int studentsNumber;

        public void GenerateRandomStudent()
        {
            FirstName = "Вася" + Student.studentsNumber;
            LastName = "Пупкин";
            Random rnd = new Random();
            DateOfBirth = new DateTime(rnd.Next(1990,2016), rnd.Next(1,13), rnd.Next(1,20));
            for (int i = 0; i < 5; i++)
            {
                Marks[i] = rnd.Next(1, 101);
            }
            Student.studentsNumber++;
        }

        public void PrintStudentToConsole()
        {
            Console.WriteLine(FirstName);
            Console.WriteLine(LastName);
            Console.WriteLine(DateOfBirth.ToString("dd/MM/yyyy"));
            Console.WriteLine(GetAverageMark());
        }

        public double GetAverageMark()
        {
            return Marks.Average();
        }
    }
}
